<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style> 
    /* margin-left:auto;margin-right:auto仅仅针对块元素有效 */
    a{
        display: block;
        margin-left: auto;
        margin-right: auto;
        width:800px;
        background: red;
    }
    </style>
</head>
<body>
    <a href="#">a</a>
</body>
</html>